home *** CD-ROM | disk | FTP | other *** search
-
-
-
- IIIIDDDDEEEENNNNTTTT((((3333NNNN)))) LLLLyyyyssssaaaattttoooorrrr AAAACCCCSSSS ((((4444 AAAApppprrrriiiillll 1111999999993333)))) IIIIDDDDEEEENNNNTTTT((((3333NNNN))))
-
-
-
- NNNNAAAAMMMMEEEE
- ident_lookup, ident_id, ident_free, id_open, id_close,
- id_query, id_parse, id_fileno - query remote IDENT server
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<iiiiddddeeeennnntttt....hhhh>>>>
-
- _H_i_g_h-_l_e_v_e_l _c_a_l_l_s
-
- IIIIDDDDEEEENNNNTTTT ****iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp((((iiiinnnntttt ffffdddd,,,, iiiinnnntttt ttttiiiimmmmeeeeoooouuuutttt))))
-
- cccchhhhaaaarrrr ****iiiiddddeeeennnntttt____iiiidddd((((iiiinnnntttt ffffdddd,,,, iiiinnnntttt ttttiiiimmmmeeeeoooouuuutttt))))
-
- vvvvooooiiiidddd iiiiddddeeeennnntttt____ffffrrrreeeeeeee((((IIIIDDDDEEEENNNNTTTT ****iiiidddd))))
-
- _L_o_w-_l_e_v_e_l _c_a_l_l_s
-
- iiiidddd____tttt ****iiiidddd____ooooppppeeeennnn((((llllaaaaddddddddrrrr,,,, ffffaaaaddddddddrrrr,,,, ttttiiiimmmmeeeeoooouuuutttt))))
- ssssttttrrrruuuucccctttt iiiinnnn____aaaaddddddddrrrr ****llllaaaaddddddddrrrr,,,, ****ffffaaaaddddddddrrrr;;;;
- ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttiiiimmmmeeeeoooouuuutttt;;;;
-
- iiiinnnntttt iiiidddd____cccclllloooosssseeee((((iiiidddd))))
- iiiidddd____tttt ****iiiidddd;;;;
-
- iiiidddd____qqqquuuueeeerrrryyyy((((iiiidddd,,,, llllppppoooorrrrtttt,,,, ffffppppoooorrrrtttt,,,, ttttiiiimmmmeeeeoooouuuutttt))))
- iiiidddd____tttt ****iiiidddd;;;;
- iiiinnnntttt llllppppoooorrrrtttt,,,, ffffppppoooorrrrtttt;;;;
- ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttiiiimmmmeeeeoooouuuutttt;;;;
-
- iiiinnnntttt iiiidddd____ppppaaaarrrrsssseeee((((iiiidddd,,,, ttttiiiimmmmeeeeoooouuuutttt,,,, llllppppoooorrrrtttt,,,, ffffppppoooorrrrtttt,,,, iiiiddddeeeennnnttttiiiiffffiiiieeeerrrr,,,,
- ooooppppssssyyyyssss,,,, cccchhhhaaaarrrrsssseeeetttt))))
- iiiidddd____tttt ****iiiidddd;;;;
- ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttiiiimmmmeeeeoooouuuutttt;;;;
- iiiinnnntttt ****llllppppoooorrrrtttt,,,, ****ffffppppoooorrrrtttt;;;;
- cccchhhhaaaarrrr ********iiiiddddeeeennnnttttiiiiffffiiiieeeerrrr,,,, ********ooooppppssssyyyyssss,,,, ********cccchhhhaaaarrrrsssseeeetttt;;;;
-
- iiiinnnntttt iiiidddd____ffffiiiilllleeeennnnoooo((((iiiidddd))))
- iiiidddd____tttt ****iiiidddd;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp tries to connect to a remote IIIIDDDDEEEENNNNTTTT server to
- establish the identity of the peer connected on _f_d, which
- should be a socket file descriptor. _t_i_m_e_o_u_t is the longest
- permissible time to block waiting for an answer, and is
- given in seconds. A value of 0 (zero) means wait
- indefinitely (which in the most extreme case will normally
- be until the underlying network times out). iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp
- returns a pointer to an _I_D_E_N_T struct, which has the
- following contents:
-
- ttttyyyyppppeeeeddddeeeeffff ssssttttrrrruuuucccctttt {{{{
- iiiinnnntttt llllppppoooorrrrtttt;;;; ////**** LLLLooooccccaaaallll ppppoooorrrrtttt ****////
-
-
-
- Page 1 (printed 12/10/98)
-
-
-
-
-
-
- IIIIDDDDEEEENNNNTTTT((((3333NNNN)))) LLLLyyyyssssaaaattttoooorrrr AAAACCCCSSSS ((((4444 AAAApppprrrriiiillll 1111999999993333)))) IIIIDDDDEEEENNNNTTTT((((3333NNNN))))
-
-
-
- iiiinnnntttt ffffppppoooorrrrtttt;;;; ////**** FFFFaaaarrrr ((((rrrreeeemmmmooootttteeee)))) ppppoooorrrrtttt ****////
- cccchhhhaaaarrrr ****iiiiddddeeeennnnttttiiiiffffiiiieeeerrrr;;;; ////**** NNNNoooorrrrmmmmaaaallllllllyyyy uuuusssseeeerrrr nnnnaaaammmmeeee ****////
- cccchhhhaaaarrrr ****ooooppppssssyyyyssss;;;; ////**** OOOOSSSS ****////
- cccchhhhaaaarrrr ****cccchhhhaaaarrrrsssseeeetttt;;;; ////**** CCCChhhhaaaarrrrsssseeeetttt ((((wwwwhhhhaaaatttt ddddiiiidddd yyyyoooouuuu eeeexxxxppppeeeecccctttt????)))) ****////
- }}}} IIIIDDDDEEEENNNNTTTT;;;;
-
- For a full description of the different fields, refer to
- _R_F_C-_1_4_1_3.
-
- All data returned by iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp (including the IDENT
- struct) points to malloc'd data, which can be freed with a
- call to iiiiddddeeeennnntttt____ffffrrrreeeeeeee.... iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp returns 0 on error or
- timeout. Presently, this should normally be taken to mean
- that the remote site is not running an IDENT server, but it
- might naturally be caused by other network related problems
- as well. NNNNooootttteeee tttthhhhaaaatttt all fields of the IDENT struct need not
- necessarily be set.
-
- iiiiddddeeeennnntttt____iiiidddd takes the same parameters as iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp but only
- returns a pointer to a malloc'd area containing the
- _i_d_e_n_t_i_f_i_e_r string, which is probably the most wanted data
- from the IDENT query.
-
- iiiiddddeeeennnntttt____ffffrrrreeeeeeee frees all data areas associated with the IDENT
- struct pointed to by _i_d, including the struct itself.
-
- _L_o_w-_l_e_v_e_l _c_a_l_l_s
-
- The low-level calls can be used when greater flexibility is
- needed. For example, if non-blocking I/O is needed, or
- multiple queries to the same host are to be made.
-
- iiiidddd____ooooppppeeeennnn opens a connection to the remote IDENT server
- referred to by _f_a_d_d_r. The timeout is specified by _t_i_m_e_o_u_t. A
- null-pointer means wait indefinitely, while a pointer to a
- zero-valued _t_i_m_e_v_a_l struct sets non-blocking I/O, in the
- same way as for sssseeeelllleeeecccctttt((((2222)))).... iiiidddd____ooooppppeeeennnn returns a pointer to an
- iiiidddd____tttt datum, which is an opaque structure to be used as
- future reference to the opened connection. When using non-
- blocking I/O it might however be useful to access the
- underlying socket file descriptior, which can be gotten at
- through the iiiidddd____ffffiiiilllleeeennnnoooo macro described below.
-
- iiiidddd____cccclllloooosssseeee closes the connection opened with iiiidddd____ooooppppeeeennnn and frees
- all data associated with _i_d.
-
- iiiidddd____qqqquuuueeeerrrryyyy sends off a query to a remote IDENT server. _l_p_o_r_t
- and _f_p_o_r_t are sent to the server to identify the connection
- for which identification is needed. _t_i_m_e_o_u_t is given as for
- iiiidddd____ooooppppeeeennnn.... If successful, iiiidddd____qqqquuuueeeerrrryyyy returns the number of bytes
- sent to the remote server. If not, -1 is returned and eeeerrrrrrrrnnnnoooo
- is set.
-
-
-
- Page 2 (printed 12/10/98)
-
-
-
-
-
-
- IIIIDDDDEEEENNNNTTTT((((3333NNNN)))) LLLLyyyyssssaaaattttoooorrrr AAAACCCCSSSS ((((4444 AAAApppprrrriiiillll 1111999999993333)))) IIIIDDDDEEEENNNNTTTT((((3333NNNN))))
-
-
-
- iiiidddd____ppppaaaarrrrsssseeee parses the reply to a query sent off by iiiidddd____qqqquuuueeeerrrryyyy
- and returns information to the locations pointed to by
- _l_p_o_r_t, _f_p_o_r_t, _i_d_e_n_t_i_f_i_e_r, _o_p_s_y_s and _c_h_a_r_s_e_t. For string data
- (_i_d_e_n_t_i_f_i_e_r, _o_p_s_y_s and _c_h_a_r_s_e_t) pointers to malloc'd space
- are returned.
-
- iiiidddd____ppppaaaarrrrsssseeee returns:
-
- 1 If completely successful.
-
- -3 Illegal reply type from remote server. _i_d_e_n_t_i_f_i_e_r
- is set to the illegal reply.
-
- -2 Cannot parse the reply from the server.
- _i_d_e_n_t_i_f_i_e_r is normally set to the illegal reply.
-
- -1 On general errors or timeout.
-
- 0 When non-blocking mode is set and iiiidddd____ppppaaaarrrrsssseeee has not
- finished parsing the reply from the remote server.
-
- 2 Indicates the query/reply were successful, but the
- remote server experienced some error. _i_d_e_n_t_i_f_i_e_r
- is set to the error message from the remote
- server.
-
- For all errors, _e_r_r_n_o is set as appropriate.
-
- iiiidddd____ffffiiiilllleeeennnnoooo is a macro that takes an iiiidddd____tttt handle and returns
- the actual socket file descriptor used for the connection to
- the remote server.
-
- EEEERRRRRRRROOOORRRRSSSS
- ETIMEDOUT The call timed out and non-blocking I/O was
- not set.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- Here's an example how to handle the reply from id_reply() in
- the case that non-blocking I/O is set. Note that id_reply()
- will return 0 as long as it's not finished parsing a reply.
-
- int rcode;
-
- ...
-
- idp = id_open(...)
-
- ...
-
- while ((rcode = id_parse(idp, timeout,
- &lport, &fport, &id, &op, &cs)) == 0)
- ;
-
-
-
- Page 3 (printed 12/10/98)
-
-
-
-
-
-
- IIIIDDDDEEEENNNNTTTT((((3333NNNN)))) LLLLyyyyssssaaaattttoooorrrr AAAACCCCSSSS ((((4444 AAAApppprrrriiiillll 1111999999993333)))) IIIIDDDDEEEENNNNTTTT((((3333NNNN))))
-
-
-
- if (rcode < 0)
- {
- if (errno == ETIMEDOUT)
- foo(); /* Lookup timed out */
- else
- bar(); /* Fatal error */
- }
- else if (rcode == 1)
- {
- /* Valid USERID protocol reply */
- }
- else if (rcode == 2)
- {
- /* Protocol ERROR reply */
- }
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- RFC-1413, socket(2), select(2)
-
- AAAAUUUUTTTTHHHHOOOORRRRSSSS
- Peter Eriksson <_p_e_n@_l_y_s_a_t_o_r._l_i_u._s_e>
- P"ar Emanuelsson <_p_e_l_l@_l_y_s_a_t_o_r._l_i_u._s_e>
-
- BBBBUUUUGGGGSSSS
- For iiiiddddeeeennnntttt____llllooooooookkkkuuuupppp and iiiiddddeeeennnntttt____iiiidddd the blocking time in extreme
- cases might be as much as three times the value given in the
- _t_i_m_e_o_u_t parameter.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 4 (printed 12/10/98)
-
-
-
-